Vector Field Visualization and Data Recovery

Vector Field Visualization and Data Recovery

  1. ggvfields
  2. Data Recovery
  3. Conclusion

ggvfields

  1. Introduction of Problem
  2. Current Solutions
  3. Proposed Solutions ggvfields

The Problem: R

library(tidyverse)

# Create a grid of points
x <- seq(-10, 10, by = 1)
y <- seq(-10, 10, by = 1)

# Prepare Data
grid <-
  expand_grid(x = x, y = y) |> 
  mutate(u = -y, v = x) |> 
  mutate(norm = sqrt(x^2 + y^2)) |> 
  mutate(u = u/max(norm), v = v/max(norm))

# Plot the vector field
ggplot(grid, aes(x = x, y = y)) +
  geom_segment(
    aes(xend = x + u, yend = y + v), 
    arrow = arrow(length = unit(0.1, "cm"))
    ) +
  theme_minimal() +
  labs(title = "Vector Field of f(x,y) = (-y, x)", 
       x = "X", y = "Y"
       )

The Problem: R

  • This is verbose
  • This is clunky
  • This requires a lot of burden on the user

Current Solutions: Python

import numpy as np
import matplotlib.pyplot as plt

# Create a grid of points
x = np.linspace(-10, 10, 20)
y = np.linspace(-10, 10, 20)
X, Y = np.meshgrid(x, y)

# Define the vector field
U = -Y
V = X

# Plot the vector field
plt.quiver(X, Y, U, V)
plt.title("Vector Field")
plt.xlabel("X")
plt.ylabel("Y")
plt.show()

Current Solutions: Mathematica

xRange = Range[-10, 10, 1];
yRange = Range[-10, 10, 1];
grid = Flatten[Table[{x, y}, {x, xRange}, {y, yRange}], 1];

(* Define the vector field *)
vectorField = Table[{x, y, -y, x}, {x, xRange}, {y, yRange}];
vectorField = Flatten[vectorField, 1];

(* Plot the vector field *)
VectorPlot[{ -y, x }, {x, -10, 10}, {y, -10, 10}, 
 VectorPoints -> Fine, VectorScale -> Small,
 AxesLabel -> {"X", "Y"},
 PlotLabel -> "Vector Field of f(x,y) = (-y, x)"]

Proposed Solutions: ggvfields

  • Introduction of the ggvfields package
  • show github

geom_vector_field

  • show base code to do this
  • show a lot of reasonable variations
  • future work

geom_streamplot

  • show base code to do this
  • show a lot of reasonable variations
  • future work

geom_complex_function

  • show base code to do this
  • show a lot of reasonable variations
  • future work

  • should i show inner code?
  • do i need to show how ggplot2 layers work?
  • how much variation do i need to do on all the options?
  • should i show how each of these functions work in other languages

Data Recovery

  1. Introduction of Problem
  2. Current Solutions
  3. Proposed Solution

The Problem:

Imagine one of several scenarios
- Researcher who desires to replicate another’s research
- Researcher who wants to use an previous study’s results as a prior for their own

Current Solutions

By hand

  • slow
  • error prone
mtcars |> 
  ggplot(aes(hp, mpg)) +
  geom_point()

Current Solutions

  • email authors
  • many reasons why this could go wrong
  • such as unwilling/unable to share data

Current Solutions

plotdigitizer
automeris.io
engegue-digitizer
(show images of this)

  • Problems: require user interaction, technical expertise, not 100% accurate

ChatGPT

  • Problems: cost money, not 100% accurate, different answers every time asked

Proposed Solution

  1. Neural Network Solution

  2. Methodology

    • All Assumptions made in first model
    • Data Generation
    • AWS implementation (details)
  3. Challenges

    • Money
    • Time
    • Size of neural network
  4. Preliminary results with assumptions

  5. Preliminary results by removing assumptions

  6. Current unsolved issues

    • Unlimited y axis
    • Learn y axis?
  7. Where to go from here

Conclusion Slides